<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="form-horizontal  h-form-warp">
          <form action="/apiFacadeModuleInfo/saveApiFacadeModuleInfo" class="form-horizontal"
                id="apiFacadeModuleInfoForm"
                method="post" role="form">
            <input id="operation" name="operation" type="hidden" value="${operation!}"/>
            <input class="form-control" id="id" name="id" type="hidden" value="${apiFacadeModuleInfo.id!}">
            <input class="form-control" id="projectId" name="projectId" type="hidden"
                   value="${apiFacadeModuleInfo.projectId!}">
            <div class="form-group">
              <label class="col-sm-3 col-xs-3 control-label">模块编码 ：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="moduleCode" name="moduleCode" required="required"
                       type="text"
                       value="${apiFacadeModuleInfo.moduleCode!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-3 col-xs-3 control-label">模块名称 ：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="moduleName" name="moduleName" required="required"
                       type="text"
                       value="${apiFacadeModuleInfo.moduleName!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-3 col-xs-3 control-label">模块描述 ：</label>
              <div class="col-sm-6 col-xs-6">
                <input class="form-control" id="moduleComment" name="moduleComment" required="required"
                       type="text"
                       value="${apiFacadeModuleInfo.moduleComment!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>

<#include "/common/jslib.html">
<!-- 弹窗下拉 -->
<script type="text/javascript">
    function returnIndex() {
        window.location.href = "/apiFacadeModuleInfo/query";
    }

    $(function () {
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        var operation = $("#operation").val();
        var api = frameElement.api, W = api.opener;
        // 弹出窗体控制
        ApiFacadeModuleInfoMgr = {
            // 初始化
            init: function () {
                // 查看的时候不显示保存按钮
                if (operation == "view") {
                    Jmts.setFormReadOnly();
                }
                api.button({
                    id: 'confirm',
                    name: '保存',
                    callback: ApiFacadeModuleInfoMgr.submitForm
                });
                api.button({
                    id: 'cancel',
                    name: '关闭'
                });
            },
            // init end

            // 提交数据
            submitForm: function () {
                Jmts.ajaxSubmit(document.getElementById("apiFacadeModuleInfoForm"), function (result) {
                    if (result.success) {
                        if (operation == 'add') {
                            W.Jmts.succTips(result.msg);
                            api.close();
                            W.location.reload();
                        } else if (operation == 'edit') {
                            W.location.reload();
                            W.Jmts.succTips(result.msg);
                        }
                    } else {
                        Jmts.warnTips(result.msg);
                    }
                });
                return false;
            }
            // submitForm end
        };
        // 执行初始化
        ApiFacadeModuleInfoMgr.init();
        // 前台验证表单
        $("#apiFacadeModuleInfoForm").validate();
    });
</script>
</body>
</html>
